﻿var body = document.querySelector("body");

var openCatalogBtn = document.getElementById("catalog");
var closeCatalogBtn = document.getElementById("catalogClose");
var catalogMenu = document.getElementById("catalogMenu");

var booksClick = document.getElementById("catalogBooks");
var spClick = document.getElementById("catalogSp");

var books = document.getElementById("books");
var sp = document.getElementById("sp");

openCatalogBtn.addEventListener("click", function () {
    catalogMenu.classList.add("catalogMenuOpen");
    body.classList.add("overflow-h");
});

closeCatalogBtn.addEventListener("click", function () {
    catalogMenu.classList.remove("catalogMenuOpen");
    body.classList.remove("overflow-h");
})


booksClick.addEventListener("click", function () {
    sp.classList.add("hidden");
    spClick.classList.remove("selected");
    booksClick.classList.add("selected");
    books.classList.remove("hidden");
})

spClick.addEventListener("click", function () {
    books.classList.add("hidden")
    spClick.classList.add("selected");
    booksClick.classList.remove("selected");
    sp.classList.remove("hidden");
})